<?php $top_cats=view::newInstance()->_get('top_categories');?>
<div id="sidenav"> 
  <!-- NAVIGATION SORTING AREA -->

<!-- LOCATION SORTING AREA -->
<?php $top_locations=view::newInstance()->_get('top_locations');?>
<div id="sidebar-navigation">
  <div class="sidenav-box" class="s-order">
  <h2 class="refine-category"> <a href="#category-tree">Refine location</a> <a href="#category-more"> <span class="icone more">X</span> </a> </h2>
  <div class="category-tree">
    <ul>
      <li> <a href="#all-categories">All Location </a>
        <ul>
        <?php foreach($top_locations as $location){?>
          <li> <a href="<?php echo $location->getURI();?>"><?php echo $location->getName(); ?></a>
            <?php if($location->hasChildrens()){?>
          <ul>
            <?php
			$childrens=$location->getChildrens();
	           foreach($childrens as $sub){?>
              <li><a href="<?php echo $sub->getURI();?>"><?php echo $sub->getName();?></a></li>
              <?php } ?>
            </ul>
            <?php }?>
          </li>
          <?php } ?>
        </ul>
      </li>
    </ul>
    <a class="s-less refine-less" href="#more">Less</a> </div>
</div>
</div>
</div>
